﻿using Nop.Core;
using Nop.Core.Domain.WindAlert;
using System;
using System.Collections.Generic;

namespace Nop.Services.WindAlert
{
    /// <summary>
    /// Winddata service
    /// </summary>
    public partial interface IForecastDataService
    {
        #region Methods

        /// <summary>
        /// Clears a log
        /// </summary>
        void ClearAll();
       
        /// <summary>
        /// Deletes a forecastData
        /// </summary>
        /// <param name="windData">forecastData</param>
        void DeleteForecastData(ForecastData forecastData);

        /// <summary>
        /// Gets all forecastDatas
        /// </summary>;
        /// <returns>forecast data collection</returns>
        IList<ForecastData> GetAllForecastData(int spotId = 0);
       
        /// <summary>
        /// Gets all forecastDatas
        /// </summary>
        /// <param name="pageIndex">Page index</param>
        /// <param name="pageSize">Page size</param>
        /// <returns>forecast data</returns>
        IPagedList<ForecastData> GetAllForecastData(int pageIndex, int pageSize, int spotId = 0);
        
        /// <summary>
        /// Gets all forecastdata items
        /// </summary>
        /// <param name="fromUtc">fvdata item creation from; null to load all records</param>
        /// <param name="toUtc">forecastdata item creation to; null to load all records</param>
        /// <param name="pageIndex">Page index</param>
        /// <param name="pageSize">Page size</param>
        /// <returns>forecastdata item collection</returns>
        IPagedList<ForecastData> GetAllForecastData(DateTime? fromUtc, DateTime? toUtc, int pageIndex, int pageSize);

        /// <summary>
        /// Gets a forecastData
        /// </summary>
        /// <param name="forecastDataId">forecast data identifier</param>
        /// <returns>forecast data</returns>
        ForecastData GetForecastDataById(int forecastDataId);
        
        /// <summary>
        /// Get forecast data items by identifiers
        /// </summary>
        /// <param name="waveataIds">forecastdata item identifiers</param>
        /// <returns>forecastdata items</returns>
        IList<ForecastData> GetForecastDataByIds(int[] forecastDataIds);

        /// <summary>
        /// Get forecast data itemby spot Id
        /// </summary>
        /// <param name="SpotIds">spot identifiers</param>
        /// <returns>forecastdata items</returns>
        IList<ForecastData> GetForecastDataBySpotId(int spotId);
       
        /// <summary>
        /// Get forecast data itemby spot Id and forecast name
        /// </summary>
        /// <param name="SpotIds">spot identifiers</param>
        /// <param name="name">name identifiers</param>
        /// <returns>forecastdata items</returns>
        ForecastData GetForecastDataBySpotIdAndName(int spotId, string name);

        /// <summary>
        /// Updates the forecast
        /// </summary>
        /// <param name="forecast">forecast</param>
        void UpdateForecastData(ForecastData forecastData);

        /// <summary>
        /// Inserts a forecastData
        /// </summary>
        /// <param name="waveData">forecast data</param>
        void InsertForecastData(ForecastData forecastData);
        

         /// <summary>
        /// Indicates whether a forecast exists
        /// </summary>
        /// <param name="forecastName">Forecast name</param>
        /// <returns>Result</returns>
        bool ForecastNameExists(string forecastName, int spotId);
        #endregion

        #region update spot forecast

        string checkForecastDate();

        List<ForecastData> UpdateForecastSpot(Spot spot);
        #endregion 
    }
}
